
<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">

        <li><div style="width:5px;height:12px;background:#00A0E9;display:inline-block;margin-right:10px"></div><div style="display: inline-block;">基础权限</div></li>

        <div class="layui-form-item" style="display:block;width:400px">
            <label class="layui-form-label" style="width:130px;">房间状态：</label>
            <div class="layui-input-block">
                <input autocomplete="off" type="checkbox" {if $row.status==1}checked=""{/if} name="status" lay-skin="switch" value='1' lay-filter="status" lay-text="开启|关闭">
            </div>
        </div>

        <div class="layui-form-item" style="display:block;width:400px">
            <label class="layui-form-label" style="width:130px;">是否开启机器人：</label>
            <div class="layui-input-block">
                <input autocomplete="off" type="checkbox" {if $row.whether_robot==1}checked=""{/if} name="whether_robot" lay-skin="switch" value='1' lay-filter="whether_robot" lay-text="开启|关闭">
            </div>
        </div>

        <div class="layui-form-item" style="display:block;width:400px">
            <label class="layui-form-label" style="width:130px;">是否开启强制登录：</label>
            <div class="layui-input-block">
                <input autocomplete="off" type="checkbox" {if $row.whether_force_login==1}checked=""{/if} name="whether_force_login" lay-skin="switch" value='1' lay-filter="whether_force_login" lay-text="开启|关闭">
            </div>
        </div>

        <div class="layui-form-item" style="display:block;width:400px">
            <label class="layui-form-label" style="width:130px;">是否开启房间加密：</label>
            <div class="layui-input-block">
                <input autocomplete="off" type="checkbox" id ="ispass" name="ispass" {if $row.ispass==1}checked=""{/if} lay-skin="switch" value='1' lay-filter="ispass" lay-text="开启|关闭">
            </div>
        </div>

        <div class="layui-form-item" style="display: none;" id = "password">
            <label class="layui-form-label">房间密码：</label>
            <div class="layui-input-block">
                <input autocomplete="off" type="text" name="password"  class="layui-input" lay-reqtext="请输入房间密码" placeholder="请输入房间密码" value="{$row.password}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">虚拟人数基数：</label>
            <div class="layui-input-block">
                <input autocomplete="off" type="text" name="fictitious_base" class="layui-input" lay-reqtext="请输入虚拟人数基数" placeholder="请输入虚拟人数基数" value="{$row.fictitious_base}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">人数浮动上限：</label>
            <div class="layui-input-block">
                <input autocomplete="off" type="text" name="fictitious_top" class="layui-input" lay-reqtext="请输入人数浮动上限" placeholder="请输入人数浮动上限" value="{$row.fictitious_top}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">人数浮动下限：</label>
            <div class="layui-input-block">
                <input autocomplete="off" type="text" name="fictitious_botton" class="layui-input" lay-reqtext="请输入人数浮动下限" placeholder="请输入人数浮动下限" value="{$row.fictitious_botton}">
            </div>
        </div>

        <div class="layui-form-item" style="display: none;">
            <label class="layui-form-label">间隔时间：</label>
            <div class="layui-input-block">
                <input autocomplete="off" type="text" name="interval_time" class="layui-input" lay-reqtext="请输入间隔时间" placeholder="请输入间隔时间" value="{$row.interval_time}">
            </div>
        </div>

    
        <li><div style="width:5px;height:12px;background:#00A0E9;display:inline-block;margin-right:10px"></div><div style="display: inline-block;">消息权限</div></li>

        <div class="layui-form-item" style="display:block;width:400px">
            <label class="layui-form-label" style="width:130px;">是否开启消息审核：</label>
            <div class="layui-input-block">
                <input autocomplete="off" type="checkbox" {if $row.message_audit==1}checked=""{/if} name="message_audit" lay-skin="switch" value='1' lay-filter="message_audit" lay-text="开启|关闭">
            </div>
        </div>

        <div class="layui-form-item" style="display:block;width:400px">
            <label class="layui-form-label" style="width:130px;">是否开启游客发言：</label>
            <div class="layui-input-block">
                <input autocomplete="off" type="checkbox" {if $row.visitors_speak==1}checked=""{/if} name="visitors_speak" lay-skin="switch" value='1' lay-filter="visitors_speak" lay-text="开启|关闭">
            </div>
        </div>


        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>

    </form>
</div>

<script>

    layui.use(['form'], function () {
        var form = layui.form;
        form.on('switch(ispass)', function (data) {
            if (data.elem.checked) {
                $("#password").show()
            }else{
                $("#password").hide()
            }
        })
    })
</script>